#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>


int main()
{
	char arr[20] = {0};
	scanf("%s", arr);

	int x = 0;
	int n = 0;

	while (arr[x++] != '0')
		n++;

	x = 0;
	while (x < n)
	{
		if (arr[x] > 64 && arr[x] < 91)
			arr[x] += 32;
		else if (arr[x] > 96 && arr[x] < 123)
			arr[x] -= 32;
		x++;
	}

	printf("%s\n", arr);
	return 0;
}
